package router

import (
	"925/api/handler"
	"925/midware"
	"github.com/gin-gonic/gin"
	"net/http"
	"time"
)

func Router() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		time.Sleep(5 * time.Second)
		c.String(http.StatusOK, "Welcome Gin Server")
	})

	//group := r.Group("/api", pkg.BaiduIf())
	//{
	r.POST("/videoAdd", handler.VideoAdd)
	//}
	r.POST("/login", handler.Login)
	group := r.Group("/api", midware.Parse())
	{
		group.POST("/vip", handler.Vip)
	}
	return r
}
